const state = {
  token: JSON.parse(localStorage.getItem('hm-news-token')) || {}
}
const mutations = {
  setToken(state, payload) {
    state.token = payload
    localStorage.setItem('hm-news-token', JSON.stringify(payload))
  },
  removeToken(state) {
    state.token = ''
    localStorage.removeItem('hm-news-token')
  }
}
const getters = {}
const actions = {}
export default {
  state,
  mutations,
  getters,
  actions,
  // 开启命名空间
  namespaced: true
}
